package name.zxw.xiaowo.bean.base;

import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;

import java.util.List;

/**
 * @author zxw
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MyPage<T> {
    /**
     * 当前页
     */
    private int pageNum;
    /**
     * 每页的数量
     */
    private int pageSize;
    /**
     * 当前页的数量
     */
    private int size;
    /**
     * 总页数
     */
    private int pages;
    /**
     * 页面数据
     */
    private List<T> data;

    public MyPage(PageInfo pageInfo) {
        this.pageNum = pageInfo.getPageNum();
        this.pageSize = pageInfo.getPageSize();
        this.size = pageInfo.getSize();
        this.pages = pageInfo.getPages();
        ModelMapper mapper = new ModelMapper();
//        this.data = pageInfo.getList().stream().map( mem->mapper.map(mem,t.getClass()));

    }


}
